import request from '@/utils/request'

// 创建应用市场
export function createApp(data) {
  return request({
    url: '/mg/app-market-manage/create',
    method: 'post',
    data: data
  })
}

// 更新应用市场
export function updateApp(data) {
  return request({
    url: '/mg/app-market-manage/update',
    method: 'put',
    data: data
  })
}

// 删除应用市场
export function deleteApp(id) {
  return request({
    url: '/mg/app-market-manage/delete?id=' + id,
    method: 'delete'
  })
}

// 获得应用市场
export function getApp(id) {
  return request({
    url: '/mg/app-market-manage/get?id=' + id,
    method: 'get'
  })
}

// 获得应用市场分页
export function getAppPage(query) {
  return request({
    url: '/mg/app-market-manage/page',
    method: 'get',
    params: query
  })
}

// 导出应用市场 Excel
export function exportAppExcel(query) {
  return request({
    url: '/mg/app-market-manage/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

//校验应用简称是否存在
export function checkAppShortIsExist(appShort) {
  return request({
    url: '/mg/app-market-manage/app-short-exist',
    method: 'get',
    params: {
      appShort
    }
  })
}
